﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using TrainingManagement.api.Models.BusinessLogic;
using TrainingManagement.api.Models.BusinessLogic.Department;
using TrainingManagement.api.Models.BusinessObjects;

namespace TrainingManagement.api.Controllers
{
    public class DepartmentController : ApiController
    {
        public Department PutDepartment(Department department)
        {
            return new DepartmentCreateOperation().Run(department);
        }

        [System.Web.Http.ActionName("Update")]
        public void PostUpdateDepartment(Department department)
        {
            new DepartmentUpdateOperation().Run(department);
        }

        public void DeleteDepartment(int departmentId)
        {
            new DepartmentDeleteOperation().Run(departmentId);
        }

        public List<Department> GetDepartment(int? departmentId)
        {
            return new DepartmentSelectOperation().Run(departmentId);
        } 

    }
}
